package tralala.client.gui;

import javax.swing.table.DefaultTableModel;

import tralala.server.data.dto.CancionDTO;


public class TableModelSearch extends DefaultTableModel {

	private static final long serialVersionUID = -7461719037402108362L;

	public TableModelSearch(int arg0, int arg1) {
		super(arg0, arg1);
	}

	public void borrar() {
		while (this.getRowCount() > 0) {
			this.removeRow(0);
		}
	}
	
	public void anyadirColumna(CancionDTO cancion) {

        this.addRow(new Object[] {cancion.getTitulo(), cancion.getArtista(), cancion.getDuracion(), cancion.getPrecio()});
	}

	public String getTitulo(int row) {
        return (String)this.getValueAt(row, 0);
	}


}